<?php

namespace app\common\model\biz;


use app\common\model\BaseModel;
use think\facade\Request;

class SysUserLogLogin extends BaseModel
{

    public static function add(string $content = '', int $userId = 0, string $token = ''): void
    {
        $data = [
            'user_id' => $userId,
            'status' => empty($token) ? '失败' : '成功',
            'token' => $token,
            'ip' => Request::ip(),
            'user_agent' => Request::header('user-agent'),
            'content' => $content,
        ];
        self::create($data);
    }
}